<?php

namespace App\Goodssmall;
use App\Models\StoreGood;
use Dcat\Admin\Grid;
use Dcat\Admin\Grid\LazyRenderable;

class Goodssmall extends LazyRenderable
{
   public function grid(): Grid
   {
       return Grid::make(new StoreGood(), function (Grid $grid) {
           $grid->column('id')->sortable();
           $grid->column('image')->image();
           $grid->column('store_name');
           $grid->column('price');
           $grid->column('stock');
           $grid->column('sales');
           $grid->column('sort');
           $grid->column('is_show')->switch();
           $grid->column('updated_at')->sortable();
           $grid->quickSearch()->placeholder('搜索...',);
           $grid->quickSearch('store_name');
       });
   }

}
